package com.yc.cloud.admin.enums;

import lombok.Getter;

/**
 * 抓图状态枚举
 *
 * @author kinggu
 * @since 2025-10-10
 */
@Getter
public enum SnapshotStatusEnum {
    /**
     * 成功
     */
    SUCCESS("SUCCESS", "成功"),
    
    /**
     * 失败
     */
    FAILED("FAILED", "失败"),
    
    /**
     * 处理中
     */
    PROCESSING("PROCESSING", "处理中");

    private final String code;
    private final String desc;

    SnapshotStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 根据code获取枚举
     */
    public static SnapshotStatusEnum fromCode(String code) {
        if (code == null) {
            return null;
        }
        for (SnapshotStatusEnum status : values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        return null;
    }
}

